
    	$(document).ready(function(){

			if(parseInt($('#spinnerId').val())<1){
				$('#spinnerId').val(1);
			}
			if(parseInt($('#spinnerId2').val())<1){
				$('#spinnerId2').val(1);
			}
    		//成品下单
    		$('#spinnerId').parent().find('button').click(function(){
    			if(parseInt($('#spinnerId').val())<1){
    				$('#spinnerId').val(1);
    			}else{
        			var downRadio=$('#down').find('input:radio:checked');
                	var patternPrintRadio=$('#patternPrintRadio').find('input:radio:checked');
                	if(downRadio.length>0&&patternPrintRadio.length>0){
                		var downRadioPrice = downRadio.parent().next().find('i').text();                   //布料
                		var patternPrintRadioPrice = patternPrintRadio.parent().next().find('i').text();   //印花
                		var spinnerM=$('#spinnerId').val();
                		
                		if(spinnerM <= 50){
                			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*spinnerM;
                		}else if(spinnerM > 50 & spinnerM <= 100){
                			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
                			+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*(spinnerM-50);
                		}else if(spinnerM > 100 & spinnerM <= 300){
                			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
    						+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*50
    						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.5)*(spinnerM-100);
                		}else if(spinnerM > 300 & spinnerM <= 500){
                			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
    						+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*50
    						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.5)*200
    						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.2)*(spinnerM-300);
                		}else if(spinnerM > 500 & spinnerM <= 1000){
                			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
    						+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*50
    						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.5)*200
    						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.2)*200
    						+ (parseFloat(downRadioPrice)*1 + parseFloat(patternPrintRadioPrice)*1.2)*(spinnerM-500);
                		}else{
                			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
    						+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*50
    						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.5)*200
    						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.2)*200
    						+ (parseFloat(downRadioPrice)*1 + parseFloat(patternPrintRadioPrice)*1.2)*500
    						+ (parseFloat(downRadioPrice)*1 + parseFloat(patternPrintRadioPrice)*1)*(spinnerM-1000);
                		}
                		
                		
                		
                		//var totalPirce=(parseFloat(downRadioPrice)+parseFloat(patternPrintRadioPrice))*spinnerM;
                		$('#downPrice').text(totalPirce.toFixed(2));
                	}
    			}
    		});
    		/*$('#spinnerId,#spinnerId2').change(function(){
    			$(this).val(parseInt($(this).val()));
    			if(parseInt($(this).val())<1){
    				$(this).val(1);
    			}
    		});*/
    		//印花加工
    		$('#spinnerId2').parent().find('button').click(function(){
    			if(parseInt($('#spinnerId2').val())<1){
    				$('#spinnerId2').val(1);
    			}else{
    			var checkedRadioLength=$('#printingTab').find('input:radio:checked').length;
    			if(checkedRadioLength>0){
    				var checkedRadioPrice=$('#printingTab').find('input:radio:checked').parent().next().find('i').text();
                	var spinnerM2=$('#spinnerId2').val();
                	
                	if(spinnerM2 < 50){
                		totalPirce2=parseFloat(checkedRadioPrice)*spinnerM2*2;
                	}else if(spinnerM2 >= 51 & spinnerM2 <= 300){
                		totalPirce2=parseFloat(checkedRadioPrice)*((spinnerM2 - 50)*1.5 + 50*2);
                	}else if(spinnerM2 > 300 & spinnerM2 <= 1000){
                		totalPirce2=parseFloat(checkedRadioPrice)*((spinnerM2 - 300)*1.2 + 250*1.5 + 50*2);
                	}else if(spinnerM2 > 1000){
                		totalPirce2=parseFloat(checkedRadioPrice)*((spinnerM2 - 1000)*1 + 700*1.2 + 250*1.5 + 50*2);
                	}
                	
                	//var totalPirce2=parseFloat(checkedRadioPrice)*spinnerM2;
                	
                	$('#downPrintPrice').text(totalPirce2.toFixed(2));
    			}
    			}
    		});
    	});
    
          
        /*头部选择--着装渲染、我的模特、成品下单、印花加工、买断花型*/
        $("ul.tab-ul li").click(function () {
        	
        	
        	$('#downPrice').text("0.00");
        	$('#downPrintPrice').text("0.00");
        	//将所有的radio的选中状态标记为未选中
        	$('input:radio:checked').attr('checked',false);
        	if($(this).index()==1)
        	{
        		xiangqing();
        	}
        	else
        	{
        	   $("ul.tab-ul li").eq($(this).index()).addClass("active").siblings().removeClass('active');
               $(".tab-sel .tab-con .tab").addClass("hide").eq($(this).index()).removeClass("hide");
        	}
          
        });
        
        /*选服装类型*/
        $(".tab  ul.cate-li li").click(function () {
            $(".tab  ul.cate-li li").eq($(this).index()).addClass("on-cate").siblings().removeClass('on-cate');
            $(".tab .buwei ul.model-li").addClass("hide").eq($(this).index()).removeClass("hide");
        }); 
        
        $('.spinner').spinner();
        
        //初始化面料材质事件
        $('#chengfen li').first().addClass('active');
        $('#down .liao-ul').first().removeClass('hide')
        
        //给印花加工下的radioButton绑定点击响应事件
        $('#printingTab').find('input:radio').click(function(){
        	var checkedRadioPrice=$('#printingTab').find('input:radio:checked').parent().next().find('i').text();
        	var spinnerM2=$('#spinnerId2').val();
        	

        	if(spinnerM2 <= 50){
        		totalPirce2=parseFloat(checkedRadioPrice)*spinnerM2*2;
        	}else if(spinnerM2 > 51 & spinnerM2 <= 300){
        		totalPirce2=parseFloat(checkedRadioPrice)*((spinnerM2 - 50)*1.5 + 50*2);
        	}else if(spinnerM2 > 300 & spinnerM2 <= 1000){
        		totalPirce2=parseFloat(checkedRadioPrice)*((spinnerM2 - 300)*1.2 + 250*1.5 + 50*2);
        	}else if(spinnerM2 > 1000){
        		totalPirce2=parseFloat(checkedRadioPrice)*((spinnerM2 - 1000)*1 + 700*1.2 + 250*1.5 + 50*2);
        	}
        	
        	
        	//var totalPirce2=parseFloat(checkedRadioPrice)*spinnerM2;
        	$('#downPrintPrice').text(totalPirce2.toFixed(2));
        });
        
        //给成品下单下的radioButton绑定点击响应事件
        $('#finishedProduct').find('input:radio').click(function(){
        	var downRadio=$('#down').find('input:radio:checked');
        	var patternPrintRadio=$('#patternPrintRadio').find('input:radio:checked');
        	if(downRadio.length>0&&patternPrintRadio.length>0){
        		var downRadioPrice=downRadio.parent().next().find('i').text();
        		var patternPrintRadioPrice=patternPrintRadio.parent().next().find('i').text();
        		var spinnerM=$('#spinnerId').val();
        		
        		
        		

        		if(spinnerM <= 50){
        			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*spinnerM;
        		}else if(spinnerM > 50 & spinnerM <= 100){
        			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
        			+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*(spinnerM-50);
        		}else if(spinnerM > 100 & spinnerM <= 300){
        			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
					+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*50
					+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.5)*(spinnerM-100);
        		}else if(spinnerM > 300 & spinnerM <= 500){
        			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
					+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*50
					+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.5)*200
					+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.2)*(spinnerM-300);
        		}else if(spinnerM > 500 & spinnerM <= 1000){
        			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
					+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*50
					+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.5)*200
					+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.2)*200
					+ (parseFloat(downRadioPrice)*1 + parseFloat(patternPrintRadioPrice)*1.2)*(spinnerM-500);
        		}else{
        			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
					+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*50
					+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.5)*200
					+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.2)*200
					+ (parseFloat(downRadioPrice)*1 + parseFloat(patternPrintRadioPrice)*1.2)*500
					+ (parseFloat(downRadioPrice)*1 + parseFloat(patternPrintRadioPrice)*1)*(spinnerM-1000);
        		}
        		
        		
        		
        		
        		//var totalPirce=(parseFloat(downRadioPrice)+parseFloat(patternPrintRadioPrice))*spinnerM;
        		$('#downPrice').text(totalPirce.toFixed(2));
        	}
        });
        
        
        $('#spinnerId').change(function(){
	        $(this).val(parseInt($(this).val()));
			if(parseInt($(this).val())<1){
				$(this).val(1);
			}else{
				var downRadio=$('#down').find('input:radio:checked');
	        	var patternPrintRadio=$('#patternPrintRadio').find('input:radio:checked');
	        	if(downRadio.length>0&&patternPrintRadio.length>0){
	        		var downRadioPrice=downRadio.parent().next().find('i').text();
	        		var patternPrintRadioPrice=patternPrintRadio.parent().next().find('i').text();
	        		var spinnerM=$('#spinnerId').val();
	        		
	        		
	        		

	        		if(spinnerM <= 50){
	        			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*spinnerM;
	        		}else if(spinnerM > 50 & spinnerM <= 100){
	        			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
	        			+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*(spinnerM-50);
	        		}else if(spinnerM > 100 & spinnerM <= 300){
	        			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
						+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*50
						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.5)*(spinnerM-100);
	        		}else if(spinnerM > 300 & spinnerM <= 500){
	        			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
						+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*50
						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.5)*200
						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.2)*(spinnerM-300);
	        		}else if(spinnerM > 500 & spinnerM <= 1000){
	        			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
						+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*50
						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.5)*200
						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.2)*200
						+ (parseFloat(downRadioPrice)*1 + parseFloat(patternPrintRadioPrice)*1.2)*(spinnerM-500);
	        		}else{
	        			totalPirce = (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*2)*50
						+ (parseFloat(downRadioPrice)*1.3 + parseFloat(patternPrintRadioPrice)*1.5)*50
						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.5)*200
						+ (parseFloat(downRadioPrice)*1.15 + parseFloat(patternPrintRadioPrice)*1.2)*200
						+ (parseFloat(downRadioPrice)*1 + parseFloat(patternPrintRadioPrice)*1.2)*500
						+ (parseFloat(downRadioPrice)*1 + parseFloat(patternPrintRadioPrice)*1)*(spinnerM-1000);
	        		}
	        		
	        		
	        		
	        		
	        		//var totalPirce=(parseFloat(downRadioPrice)+parseFloat(patternPrintRadioPrice))*spinnerM;
	        		$('#downPrice').text(totalPirce.toFixed(2));

	        	}
				
			}

			
			
			
        });
        $("#spinnerId2").change(function(){
	        $(this).val(parseInt($(this).val()));
			if(parseInt($(this).val())<1){
				$(this).val(1);
			}else{

				var downRadio=$('#yinhua').find('input:radio:checked');
	        	if(downRadio.length>0){
	        		
		        	var checkedRadioPrice=$('#printingTab').find('input:radio:checked').parent().next().find('i').text();
		        	var spinnerM2=$('#spinnerId2').val();
		        	
	
		        	if(spinnerM2 <= 50){
		        		totalPirce2=parseFloat(checkedRadioPrice)*spinnerM2*2;
		        	}else if(spinnerM2 >= 51 & spinnerM2 <= 300){
		        		totalPirce2=parseFloat(checkedRadioPrice)*((spinnerM2 - 50)*1.5 + 50*2);
		        	}else if(spinnerM2 > 300 & spinnerM2 <= 1000){
		        		totalPirce2=parseFloat(checkedRadioPrice)*((spinnerM2 - 300)*1.2 + 250*1.5 + 50*2);
		        	}else if(spinnerM2 > 1000){
		        		totalPirce2=parseFloat(checkedRadioPrice)*((spinnerM2 - 1000)*1 + 700*1.2 + 250*1.5 + 50*2);
		        	}
		        	
	        	
	        	//var totalPirce2=parseFloat(checkedRadioPrice)*spinnerM2;
	        	$('#downPrintPrice').text(totalPirce2.toFixed(2));

	        	}
			}
        	

    	
        });